package com.wonsec.useragent.config;

import com.wonsec.useragent.aspect.ChannelTrackingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author： mzy
 * @Date： 2025/5/13 下午2:42
 * @Describe：
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private ChannelTrackingInterceptor channelTrackingInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(channelTrackingInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/static/**", "/error");
    }
}
